package br.com.dev.tcc.builder;

import br.com.dev.tcc.bean.UtilitariosViewItem;
import br.com.dev.tcc.interfaces.UtilitariosItemView;

public class UtilitariosViewItemBuilder {

	private UtilitariosViewItem item;

	public UtilitariosViewItemBuilder viewToInflate(UtilitariosItemView view) {

		if (item == null)
			item = new UtilitariosViewItem();

		item.setViewItemToInflate(view);

		return this;
	}

	public UtilitariosViewItemBuilder text(String text) {

		if (item == null)
			item = new UtilitariosViewItem();

		item.setText(text);

		return this;
	}

	public UtilitariosViewItemBuilder icon(int iconRes) {

		if (item == null)
			item = new UtilitariosViewItem();

		item.setIcon(iconRes);

		return this;
	}

	public UtilitariosViewItem create() {

		UtilitariosViewItem itemToReturn = item;

		item = null;

		return itemToReturn;
	}
}
